package com.yxw.blog.service;

import com.yxw.blog.bean.entity.User;
import com.yxw.blog.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author yexinwei
 */
@Service
public class RegisterService {

    @Autowired
    private UserDao userDao;

    public User checkName(String name){
        return userDao.getUserByName(name);
    }

    public Integer register(String name , String password , String defaultHead){
        return userDao.addUser(name,password,defaultHead);
    }

    public User getNewUser(String name){
        return userDao.getUserByName(name);
    }
}
